home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
- Message-ID: <1996Mar16.175143.10948@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <314ad16d.86316693@news>
- Date: Sat, 16 Mar 1996 17:51:43 GMT
-
- In article <314ad16d.86316693@news>, mao@tiac.net (Mark A. Odell) writes:
- >On Fri, 15 Mar 1996 18:33:02 GMT, szh@zcon.com (Syed Zaeem Hosain) wrote:
- >
- >>In article <3148DBB6.1353@hawaii.edu>, Dave Carien <davec@hawaii.edu> writes:
- >>>Yes or no on this, I just recently got confused by two different books. I
- >>>assume that the declaration foo[80] allocates storage for elements 0-79.
- >
- >// Yes. This works nice and safely for any array of known size.
- >foo[sizeof(foo)-1] = '\0';
-
- Uhhh ... careful with your editing, please! I did not say the above.
- My response was a simple "Y" as the original poster requested.
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-